package cn.edu.ujn.ch17.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.ujn.ch17.dao.Customer;
import cn.edu.ujn.ch17.dao.CustomerMapper;
@Service
public class CustomerService implements ICustomerService{
	@Autowired
	private CustomerMapper customerDao;

	@Override
	public Customer findById(int id) {
		// TODO 自动生成的方法存根
		return this.customerDao.selectByPrimaryKey(id);
	}

	@Override
	public Customer add(Customer customer) {
		// TODO 自动生成的方法存根
		int insert=this.customerDao.insert(customer);
		return customer;
	}

	@Override
	public List<Customer> findAll() {
		// TODO 自动生成的方法存根
		List<Customer> list = this.customerDao.findAll();
		return list;
	}

}
